package com.itheima.edu.info.manager.day13;

public class synchronizedTest implements Runnable {
    private int a = 2000;

    @Override
    public void run() {
        while (true){
        synchronized (this) {
                if(a>0){
                    a--;
                    System.out.println(Thread.currentThread().getName()+"还有"+a+"票");
                }
            }

        }
    }
}
